#include "cLang.h"

CLanguage::CLanguage(   const string& name,
                        const string& compile_option,
                        const string& run_option) : CompileLanguage(name) {
    this->compile_option = compile_option;
    this->run_option = run_option;
    suffix = "c";
    disableSysCallSet = { 
        generate_seccomp_ruler(__NR_fork), 
        generate_seccomp_ruler(__NR_vfork), 
        generate_seccomp_ruler(__NR_clone) 
    };
}
std::string CLanguage::compileFileStr(std::string filename, std::string target) const {
    if (target == "") {
        target = getBinaryFilename(filename);
    }
    string command = "gcc -o " + target + " " + filename + " -lm -fmax-errors=10 " + compile_option;
    return command;
}


const Language* C99_LANG = new CLanguage{"c99", " -std=c99 "};
const Language* C11_LANG = new CLanguage{"c11", " -std=c11 "};

